/*
 * @Author: nqx2007 fenglimima334@163.com
 * @Date: 2023-12-04 19:35:23
 * @LastEditors: nqx2007 fenglimima334@163.com
 * @LastEditTime: 2023-12-07 16:55:58
 * @FilePath: /operator-manager/src/components/RightContent/index.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useEmotionCss } from '@ant-design/use-emotion-css';
import { useModel } from '@umijs/max';
import React from 'react';
import Avatar from './AvatarDropdown';

export type SiderTheme = 'light' | 'dark';

const GlobalHeaderRight: React.FC = () => {
  const className = useEmotionCss(() => {
    return {
      display: 'flex',
      height: '48px',
      marginLeft: 'auto',
      overflow: 'hidden',
      gap: 8,
    };
  });
  const actionClassName = useEmotionCss(({ token }) => {
    return {
      display: 'flex',
      float: 'right',
      height: '48px',
      marginLeft: 'auto',
      overflow: 'hidden',
      cursor: 'pointer',
      padding: '0 12px',
      borderRadius: token.borderRadius,
      '&:hover': {
        backgroundColor: token.colorBgTextHover,
      },
    };
  });

  const { initialState } = useModel('@@initialState');

  if (!initialState) {
    return null;
  }
  return (
    <div className={className}>
      <span
        className={actionClassName}
      >
      </span>
      <Avatar menu={true} />
    </div>
  );
};
export default GlobalHeaderRight;
